﻿@model KRM.Core.tblKRMTradeCustomer
@{
    ViewBag.Title = "Account Detail";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/js/trade.js"></script>
<script src="~/js/tabletocsv.js"></script>
<div class="container-fluid">
    <div class="box">
        <div class="page-header"></div>
        <div class="fieldset">
            <div class="legend"><span>Trade account</span></div>
            <div class="row-fluid">
                <div class="span2">
                    <a type="button" class="btn btn-primary" href="/trade/accountdetail/0">Create New Account</a>
                </div>
                <div class="span1">
                    <input type="button" class="btn btn-primary btn-updatemargin" value="UpdateMargin" @(Model.TradeAccNumber > 0 ? "" : "disabled=disable") />
                </div>
                <div class="span1 text-right">
                    Search
                </div>
                <form action="/trade/searchtradecustomer" method="POST" class="margin0 span8 row-fluid" id="fr-searchtradecustomer">
                    <div class="span4">
                        <input class="input-block-level" type="text" name="search" id="search"value="@Request["search"]" />
                    </div>
                    <div class="span2">
                        <input class="input-block-level btn btn-primary" style="width: 100%" type="submit" value="Search" />
                    </div>
                    <div class="span6">
                        @Html.DropDownList("TradeAccNumber", null, new { @class = "input-block-level", @id = "cb-tradecustomer", @onchange = "window.location = '/trade/accountdetail/' + this.value;" })
                    </div>
                </form>
            </div>
        </div>
        <div class="fieldset pn-accountdetail" style="@(ViewBag.IsEmpty ? "display:none" : "")">
            <div class="legend"><span>Trade Account Details</span></div>
            <ul class="tabs tabs-inline tabs-top orderdetail-task-tabs margin0">
                <li class="active">
                    <a href="#accountinfo" data-toggle="tab">Account Info</a>
                </li>
                <li>
                    <a href="#productprice" data-toggle="tab">Product / Price Lists</a>
                </li>
                <li>
                    <a href="#orderhistory" data-toggle="tab">Order History</a>
                </li>
                <li>
                    <a href="#invoicing" data-toggle="tab">Invoicing</a>
                </li>
            </ul>

            <div class="tab-content padding tab-content-inline tab-content-bottom orderdetail-task-tabs-content">
                <div class="tab-pane active" id="accountinfo">
                    @Html.Partial("AccountInfo", Model)
                </div>
                <div class="tab-pane" id="productprice">
                    @Html.Partial("ProductPriceLists", Model)
                </div>
                <div class="tab-pane" id="orderhistory">
                    @Html.Partial("OrderHistory", Model)
                </div>
                <div class="tab-pane" id="invoicing">
                    @Html.Partial("Invoicing", Model)
                </div>
            </div>
        </div>
        <div class="border-padding10 text-right">
            <input type="button" class="btn btn-primary" value="Save" style="padding: 10px 40px" onclick="SaveAccountDetail()" />
        </div>
    </div>
</div>

